Command Line Support
The Execute Process node can be added to the master flow to enable you to call and execute external code and applications. You can use this node to run any cmd commands that exists on the Pyramid server.
This can be used for all manner of tasks, including renaming or moving files, pinging the server, and more.
Execute Process Node
To execute commands, add the Execute Process node to the master flow (blue arrow below), and configure its properties (green highlight below).
Execute Process Properties
General
Under the general properties, name the node and add a description.
Execute process
Add your command in the script window. You can write or paste a script directly, or open the PQL editor to build a script.
Under the script window are 4 options:
Expression: enable to create a PQL expression. When enabled, a PQL icon will appear in the script window; click the icon to open the PQL editor.
Load result into variable: load the script results into the selected variable.
Load error into variable: if the script returns an error, load the error into the selected variable.
Load status code into variable: if the script returns a status code, load it into the selected variable
Test the Command
You can test the node by right clicking on it and selecting Execute from the context menu:
The progress panel will display the progress of the execution, and the Variables can be opened to see the command results:
This example uses the Execute Process node to execute a ping command to ping the server. The results of the command are then loaded into a variable. A conditional node is added, with an expression stating that the results in the variable must contain the string "lost = 0". If this resolves to true, the data model will be processed. If it resolves to false, an email will be triggered instead.
Step 1
Add the Execute Process node and enter the command in its script window. In this example, a simple script is entered to ping the server:
Step 2
Determine what to load into the variable; you can load the results, error, or status code into the given variable. In this example, the results will be loaded into a string variable:
Step 3
Connect the Conditional node to the Execute Process node:
Step 4
Configure a PQL expression on the Conditional node; in this example the Contains function is used:
Contains(@Variable, "lost = 0")
Step 5
For the True condition, add a Data Flow node; if the results loaded into the variable by the ping command show "lost = 0", the data flow will be processed.
For the False condition, add an Email node; if the conditional statement resolves to false, an email will be triggered. Under the email's content field (green highlight below) enable 'Expression' and add the PQL expression "@variableName" to pass the results of the command from the variable into the email.